<?php
/**
 * Created by PhpStorm.
 * User: divya
 * Date: 2018/7/31
 * Time: 下午2:24
 */

namespace app\api\model;


class User extends BaseModel
{
    public function address(){
        return $this->hasOne('UserAddress',
            'user_id','id');
    }
    public static function getByopenId($id)
    {
        $user = self::where('openid','=',$id)->find();
        return $user;
    }

}